/* ----------------------------------------------------------------------------------------------------------------
 * IEntity
 * ----------------------------------------------------------------------------------------------------------------
 */

/* 

   ②realRect  : 真实矩形，格子碰撞检测，实体间碰撞检测 --- > 绑定单一渲染器
  
 */ 
package pure.engine.entity 
{
	import flash.display.BitmapData;
	import flash.events.IEventDispatcher;
	import flash.geom.Rectangle;
	import flash.events.IEventDispatcher;
	
	import pure.engine.core.IVisible;
	import pure.engine.renderer.IAnimation;
	import pure.engine.renderer.IRenderer;
	import pure.engine.renderer.IShape;
	import pure.engine.renderer.IText;
	import pure.engine.status.IStatus;
	import pure.engine.world.WorldContent;
	
	
	/// @eventType	pure.engine.events.EntityMouseEvent.CLICK
	[Event(name="click", type="pure.engine.events.EntityMouseEvent")] 

	/// @eventType	pure.engine.events.EntityMouseEvent.MOUSE_DOWN
	[Event(name="mouseDown", type="pure.engine.events.EntityMouseEvent")] 

	/// @eventType	pure.engine.events.EntityMouseEvent.MOUSE_UP
	[Event(name="mouseUp", type="pure.engine.events.EntityMouseEvent")] 

	/// @eventType	pure.engine.events.EntityMouseEvent.MOUSE_MOVE
	[Event(name="mouseMove", type="pure.engine.events.EntityMouseEvent")] 

	/// @eventType	pure.engine.events.EntityMouseEvent.MOUSE_OUT
	[Event(name="mouseOut", type="pure.engine.events.EntityMouseEvent")] 

	/// @eventType	pure.engine.events.EntityMouseEvent.MOUSE_OVER
	[Event(name = "mouseOver", type = "pure.engine.events.EntityMouseEvent")] 
	
	
	/**
	 * 实体接口
	 * 
	 * @author ＃Pure
	 * 
	 * @see WorldContent
	 * @see Entity
	 * @see IRenderer
	 */
public interface IEntity extends IVisible, IEventDispatcher
{


	/**
	 * 移动
	 * @param posX
	 * @param posY
	 */
	function move(posX:Number, posY:Number):void
		
	
	/**
	 * 位移
	 * 
	 * @param offsetX
	 * @param offsetY
	 */
	function offset(offsetX:Number, offsetY:Number):void
	
	
	/**
	 * 杀死
	 */
	function kill():void
		
		
	
	
	//======================
	// Renderer !!
	//======================
	
	function createAnimationRenderer(section:String = null, name:String = null, isRealRenderer:Boolean = false):IAnimation
	function createShapeRenderer(offsetX:Number = 0, offsetY:Number = 0, name:String = null, isRealRenderer:Boolean = false):IShape
	function createTextRenderer(width:Number, height:Number, text:String, name:String = null,
								offsetX:Number = 0, offsetY:Number = 0,isRealRenderer:Boolean = false):IText;

	function get headRenderer():IRenderer;
	function get tailRenderer():IRenderer;
	function getRenderer(name:String):IRenderer;
	
	
	
	
	//======================
	// Status !!
	//======================

	/**
	 * 添加状态
	 * 
	 * @param S
	 * @param name
	 */
	function addStatus(S:IStatus, name:String = 'S'):void;
	
	
	/**
	 * 移除状态
	 * 
	 * @param name
	 */
	function removeStatus(name:String):void;
	
	
	/**
	 * 清除状态
	 */
	function clearAllStatus():void;
	
	
	/**
	 * 获取状态
	 * 
	 * @param name
	 */
	function getStatus(name:String = null):IStatus;

	
	
	
	
	//======================
	// Property
	//====================== 
	
	/**
	 * 识别
	 * 
	 * @see EntityManager - ＃register
	 */
	function get id():int;
	
		
	/**
	 * 名字
	 * 
	 * @see EntityPool - ＃makeEntity
	 */
	function get name():String

		
	/**
	 * 世界Content
	 */
	function get worldContent():WorldContent

		

	/**
	 * 是否可交互
	 */
	function get interactive():Boolean
	function set interactive(b:Boolean):void
	

	/**
	 * 世界坐标X
	 */
	function get x():Number
	function set x(v:Number):void
	
	
	/**
	 * 世界坐标Y
	 */
	function get y():Number
	function set y(v:Number):void
	

	/**
	 * 矩形
	 */
	function get realRect():Rectangle
	function get worldRect():Rectangle


}
	
}